package com.koron.operation.classes.shift.service;


import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.koron.bean.query.PageQuery;
import com.koron.operation.classes.shift.bean.po.ClassesWorkCompletion;
import com.koron.operation.classes.shift.bean.query.WorkFeignQuery;
import org.koron.ebs.mybatis.SessionFactory;

import java.util.List;

/**
 * 工作完成情况(ClassesWorkCompletion)表服务接口
 *
 * @author jzp
 * @since 2021-10-27 18:36:23
 */
public interface ClassesWorkCompletionService {

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    ClassesWorkCompletion getById(SessionFactory factory, String id);

    /**
     * 查询所有数据
     *
     * @param classesWorkCompletion 查询条件对象
     * @return 列表结果集
     */
    List<ClassesWorkCompletion> list(SessionFactory factory, ClassesWorkCompletion classesWorkCompletion);

    List<ClassesWorkCompletion> getFeignByCondition(WorkFeignQuery extractWorkFeignQuery);

    /**
     * 分页查询
     * classesWorkCompletion 分页对象
     *
     * @return 对象列表
     */
    default PageInfo<ClassesWorkCompletion> page(SessionFactory factory, PageQuery pageQuery, ClassesWorkCompletion classesWorkCompletion) {
        PageHelper.startPage(pageQuery.getPage(), pageQuery.getPageSize(), pageQuery.getOrderBy());
        List<ClassesWorkCompletion> classesWorkCompletionList = list(factory, classesWorkCompletion);
        return new PageInfo<>(classesWorkCompletionList);
    }

    /**
     * 新增数据
     *
     * @param classesWorkCompletion 实例对象
     * @return 是否成功
     */
    boolean save(SessionFactory factory, ClassesWorkCompletion classesWorkCompletion);

    boolean saveBatch(SessionFactory factory, List<ClassesWorkCompletion> workCompletions);

    /**
     * 修改数据
     *
     * @param classesWorkCompletion 实例对象
     * @return 是否成功
     */
    boolean update(SessionFactory factory, ClassesWorkCompletion classesWorkCompletion);

    /**
     * 通过主键删除数据
     *
     * @param ids 主键
     * @return 是否成功
     */
    boolean deleteBatchIds(SessionFactory factory, List<String> ids);

    boolean removeByRecordId(SessionFactory factory, String recordId);

}
